package com.project.springboot.java8;

/**
 * description: 学生实体类
 * @author 朱正磊
 * @date 2023-11-15 13:09:15
 */
public class MyStudent implements Comparable<MyStudent> {

    /**
     * 姓名
     */
    private String name;

    /**
     * 年龄
     */
    private Integer age;

    public MyStudent(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public int compareTo(MyStudent o) {
        return name.compareTo(o.name);
    }

    @Override
    public String toString() {
        return name + "-" + age;
    }

}
